﻿<Window x:Class="DemoDataBinding.DataGridSimple"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="DataGridSimple" Height="391" Width="419">
    <Window.Resources>
        <Style TargetType="DataGrid">
            <Setter Property="Margin" Value="5"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <DataGrid Grid.Column="0" ItemsSource="{Binding Path=Records}" 
                  AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=Name}" Header="Name" IsReadOnly="True" />
                <DataGridTemplateColumn Header="Increase">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Content="{Binding Path=Number}"
                                    Command="{Binding Path=IncrementCmd}"></Button>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
        <DataGrid Grid.Column="1" ItemsSource="{Binding Path=Records}" 
                  AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=Name}" Header="Name" IsReadOnly="True" />
                <DataGridTextColumn Binding="{Binding Path=Number}" Header="Number" />
            </DataGrid.Columns>
        </DataGrid>

    </Grid>
</Window>
